package com.lzf.yh.controller;

import com.lzf.yh.commons.JsonBean;
import com.lzf.yh.entity.OrderInfo;
import com.lzf.yh.userService.OrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Wyz
 * @Date: 2021/4/17 13:27
 * @Description:
 */
@RestController
public class OrderInfoController {

    @Autowired
    private OrderInfoService orderInfoService;


    @PostMapping("insertOrderInfo")
    public JsonBean insertOrderInfo(OrderInfo orderInfo) {
        return orderInfoService.insertOrderInfo(orderInfo);
    }


    @PostMapping("updateOrderInfoStartsToOneByOrderInfoId")
    public JsonBean updateOrderInfoStartsToOneByOrderInfoId(String orderid, Integer userid) {
        return orderInfoService.updateOrderInfoStartsToOneByOrderInfoId(orderid, userid);
    }

    @PostMapping("selectAllOrderInfoByUserID")
    public JsonBean selectAllOrderInfoByUserId(Integer userid) {
        return orderInfoService.selectAllOrderInfoByUserID(userid);
    }


    @GetMapping("selectOrderInfoStartsToThreeByOrderInfoId")
    public JsonBean selectOrderInfoStartsToThreeByOrderInfoId(String orderId) {
        return orderInfoService.updateOrderInfoStartsToThreeByOrderInfoId(orderId);
    }

    @GetMapping("selectAllOrderInfoStatusYesZeroByUserId")
    public JsonBean selectAllOrderInfoStatusYesZeroByUserId(Integer userid) {
        return orderInfoService.selectAllOrderInfoStatusYesZeroByUserId(userid);
    }

    @GetMapping("selectAllOrderInfoStatusYesOneByUserId")
    public JsonBean selectAllOrderInfoStatusYesOneByUserId(Integer userid) {
        return orderInfoService.selectAllOrderInfoStatusYesOneByUserId(userid);
    }

    @GetMapping("selectAllOrderInfoStatusYesTwoByUserId")
    public JsonBean selectAllOrderInfoStatusYesTwoByUserId(Integer userid) {
        return orderInfoService.selectAllOrderInfoStatusYesTwoByUserId(userid);
    }

    @GetMapping("selectAllOrderInfoStatusYesThreeByUserId")
    public JsonBean selectAllOrderInfoStatusYesThreeByUserId(Integer userid) {
        return orderInfoService.selectAllOrderInfoStatusYesThreeByUserId(userid);
    }

}
